<!DOCTYPE HTML>
<html lang="zh-hans" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>winsorize() | 量化投资程序 帮助文档</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        <meta name="author" content="量化投资班二期 第1组">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-back-to-top-button/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-chapter-fold/chapter-fold.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-expandable-chapters/expandable-chapters.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-splitter/splitter.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-code/plugin.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-auto-scroll-table/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../factorProcess/neutralize.html" />
    
    
    <link rel="prev" href="../factorProcess/describe.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="5.2"
        data-chapter-title="winsorize()"
        data-filepath="factorProcess/winsorize.md"
        data-basepath=".."
        data-revision="Sat Jul 24 2021 19:32:14 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
                
                <li>
                    <a href="https://224466414.github.io/Quantitative_Investment_Help/" target="blank" class="custom-link">Home</a>
                </li>
            
            

            
            <li class="divider"></li>
            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        目录
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="getDate/getDate.html">
            
                
                    <a href="../getDate/getDate.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        日期获取模块 getDate
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="getDate/dateclass.html">
            
                
                    <a href="../getDate/dateclass.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        dateclass()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="getDate/dates.html">
            
                
                    <a href="../getDate/dates.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        针对日期的方法
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="getDate/dateclass.get_dates.html">
            
                
                    <a href="../getDate/dateclass.get_dates.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.1.</b>
                        
                        dateclass.get_dates()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="getDate/dateclass.get_beforeDate.html">
            
                
                    <a href="../getDate/dateclass.get_beforeDate.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.2.</b>
                        
                        dateclass.get_beforeDate()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="getDate/dateclass.get_afterDate.html">
            
                
                    <a href="../getDate/dateclass.get_afterDate.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.3.</b>
                        
                        dateclass.get_afterDate()
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="getDate/months.html">
            
                
                    <a href="../getDate/months.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        针对月份的方法
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="getDate/dateclass.get_months.html">
            
                
                    <a href="../getDate/dateclass.get_months.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.1.</b>
                        
                        dateclass.get_months()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="getDate/dateclass.get_BOMs.html">
            
                
                    <a href="../getDate/dateclass.get_BOMs.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.2.</b>
                        
                        dateclass.get_BOMs()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="getDate/dateclass.get_EOMs.html">
            
                
                    <a href="../getDate/dateclass.get_EOMs.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.3.</b>
                        
                        dateclass.get_EOMs()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="getDate/dateclass.get_DUMs.html">
            
                
                    <a href="../getDate/dateclass.get_DUMs.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.4.</b>
                        
                        dateclass.get_DUMs()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="getDate/dateclass.get_beforeMonth.html">
            
                
                    <a href="../getDate/dateclass.get_beforeMonth.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.5.</b>
                        
                        dateclass.get_beforeMonth()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="getDate/dateclass.get_afterMonth.html">
            
                
                    <a href="../getDate/dateclass.get_afterMonth.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.6.</b>
                        
                        dateclass.get_afterMonth()
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="getDate/cycles.html">
            
                
                    <a href="../getDate/cycles.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        针对周期的方法
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="getDate/dateclass.get_cycles.html">
            
                
                    <a href="../getDate/dateclass.get_cycles.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.1.</b>
                        
                        dateclass.get_cycles()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="getDate/dateclass.get_BOCs.html">
            
                
                    <a href="../getDate/dateclass.get_BOCs.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.2.</b>
                        
                        dateclass.get_BOCs()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="getDate/dateclass.get_EOCs.html">
            
                
                    <a href="../getDate/dateclass.get_EOCs.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.3.</b>
                        
                        dateclass.get_EOCs()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="getDate/dateclass.get_DUCs.html">
            
                
                    <a href="../getDate/dateclass.get_DUCs.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.4.</b>
                        
                        dateclass.get_DUCs()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="getDate/dateclass.get_beforeCycle.html">
            
                
                    <a href="../getDate/dateclass.get_beforeCycle.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.5.</b>
                        
                        dateclass.get_beforeCycle()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="getDate/dateclass.get_afterCycle.html">
            
                
                    <a href="../getDate/dateclass.get_afterCycle.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.6.</b>
                        
                        dateclass.get_afterCycle()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="getDate/dateclass.get_currentCycle.html">
            
                
                    <a href="../getDate/dateclass.get_currentCycle.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.7.</b>
                        
                        dateclass.get_currentCycle()
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="getStock/getStock.html">
            
                
                    <a href="../getStock/getStock.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        股票日频数据获取模块 getStock
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="getStock/stockclass.html">
            
                
                    <a href="../getStock/stockclass.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        stockclass()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="getStock/stockclass.read_data.html">
            
                
                    <a href="../getStock/stockclass.read_data.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        stockclass.read_data()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="getStock/stockclass.get_stockPools.html">
            
                
                    <a href="../getStock/stockclass.get_stockPools.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        stockclass.get_stockPools()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="getStock/stockclass.get_data.html">
            
                
                    <a href="../getStock/stockclass.get_data.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        stockclass.get_data()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="getStock/stockclass.get_names.html">
            
                
                    <a href="../getStock/stockclass.get_names.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        stockclass.get_names()
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="getQuote/getQuote.html">
            
                
                    <a href="../getQuote/getQuote.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        股票分钟频数据获取模块 getQuote
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="getQuote/quoteclass.html">
            
                
                    <a href="../getQuote/quoteclass.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        quoteclass()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="getQuote/quoteclass.read_data.html">
            
                
                    <a href="../getQuote/quoteclass.read_data.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        quoteclass.read_data()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="getQuote/quoteclass.get_data.html">
            
                
                    <a href="../getQuote/quoteclass.get_data.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        quoteclass.get_data()
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" data-path="getIndex/getIndex.html">
            
                
                    <a href="../getIndex/getIndex.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.</b>
                        
                        指数数据获取模块 getIndex
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="getIndex/indexclass.html">
            
                
                    <a href="../getIndex/indexclass.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        indexclass()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="getIndex/indexclass.read_data.html">
            
                
                    <a href="../getIndex/indexclass.read_data.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        indexclass.read_data()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="getIndex/indexclass.get_data.html">
            
                
                    <a href="../getIndex/indexclass.get_data.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.</b>
                        
                        indexclass.get_data()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4" data-path="getIndex/indexclass.get_infos.html">
            
                
                    <a href="../getIndex/indexclass.get_infos.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.</b>
                        
                        indexclass.get_infos()
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" data-path="factorProcess/factorProcess.html">
            
                
                    <a href="../factorProcess/factorProcess.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.</b>
                        
                        因子处理模块 factorProcess
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="factorProcess/describe.html">
            
                
                    <a href="../factorProcess/describe.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        describe()
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="5.2" data-path="factorProcess/winsorize.html">
            
                
                    <a href="../factorProcess/winsorize.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        winsorize()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" data-path="factorProcess/neutralize.html">
            
                
                    <a href="../factorProcess/neutralize.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.</b>
                        
                        neutralize()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="factorProcess/normalize.html">
            
                
                    <a href="../factorProcess/normalize.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        normalize()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="factorProcess/standardize.html">
            
                
                    <a href="../factorProcess/standardize.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        standardize()
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" data-path="factorTest/factorTest.html">
            
                
                    <a href="../factorTest/factorTest.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.</b>
                        
                        因子检验模块 factorTest
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="factorTest/ICIRclass.html">
            
                
                    <a href="../factorTest/ICIRclass.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        ICIRclass()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="factorTest/ICIRclass.get_result.html">
            
                
                    <a href="../factorTest/ICIRclass.get_result.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        ICIRclass.get_result()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" data-path="factorTest/ICIRclass.save_result.html">
            
                
                    <a href="../factorTest/ICIRclass.save_result.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.</b>
                        
                        ICIRclass.save_result()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="factorTest/groupclass.html">
            
                
                    <a href="../factorTest/groupclass.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        groupclass()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="factorTest/groupclass.get_result.html">
            
                
                    <a href="../factorTest/groupclass.get_result.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        groupclass.get_result()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="factorTest/groupclass.save_result.html">
            
                
                    <a href="../factorTest/groupclass.save_result.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        groupclass.save_result()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="factorTest/regressionclass.html">
            
                
                    <a href="../factorTest/regressionclass.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        regressionclass()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.8" data-path="factorTest/regressionclass.get_result.html">
            
                
                    <a href="../factorTest/regressionclass.get_result.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.8.</b>
                        
                        regressionclass.get_result()
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.9" data-path="factorTest/regressionclass.save_result.html">
            
                
                    <a href="../factorTest/regressionclass.save_result.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.9.</b>
                        
                        regressionclass.save_result()
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" data-path="example/example.html">
            
                
                    <a href="../example/example.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.</b>
                        
                        因子计算范例
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="example/MKT-SMB-HML.html">
            
                
                    <a href="../example/MKT-SMB-HML.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        计算 MKT/SMB/HML
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="example/iDStd-iDSkew-iDKurt.html">
            
                
                    <a href="../example/iDStd-iDSkew-iDKurt.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        计算 iDStd/iDSkew/iDKurt
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="example/SmartMoney.html">
            
                
                    <a href="../example/SmartMoney.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        计算 SmartMoney
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" data-path="example/factorTest.html">
            
                
                    <a href="../example/factorTest.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.</b>
                        
                        进行因子预处理与有效性检验
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本书使用 GitBook 发布
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../" >量化投资程序 帮助文档</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="winsorize">winsorize()</h1>
<pre><code class="lang-python">winsorize(data, type=<span class="hljs-string">&apos;Boxplot&apos;</span>, times=<span class="hljs-number">1</span>, threshold=<span class="hljs-number">0.1</span>, scope=<span class="hljs-number">3</span>)
</code></pre>
<ol>
<li><p>&#x91CA;&#x4E49;</p>
<p> &#x6839;&#x636E;&#x8BBE;&#x5B9A;&#x7684;&#x53BB;&#x6781;&#x503C;&#x65B9;&#x6CD5;&#x53BB;&#x9664;&#x6240;&#x8F93;&#x5165;&#x56E0;&#x5B50;&#x6570;&#x636E;&#x7684;&#x6781;&#x503C;&#x3002;</p>
</li>
<li><p>&#x53C2;&#x6570;</p>
<p><code>data</code></p>
<ul>
<li>&#x91CA;&#x4E49;<br>  &#x8F93;&#x5165;&#x7684;&#x56E0;&#x5B50;&#x6570;&#x636E;<br>  &#x9700;&#x8981;&#x4EE5;&#x6570;&#x636E;&#x6846;(pd.DataFrame)&#x683C;&#x5F0F;&#x8F93;&#x5165;&#xFF0C;&#x5E76;&#x4E14;&#x4FDD;&#x8BC1;&#x5176;index&#x4E3A;&#x8BC1;&#x5238;&#x4EE3;&#x7801;&#xFF0C;columns&#x4E3A;&#x4EA4;&#x6613;&#x6708;&#x4EFD;/&#x65E5;&#x671F;&#x3002;</li>
<li>&#x7C7B;&#x578B;<br>  &#x6570;&#x636E;&#x6846;(pd.DataFrame)</li>
</ul>
<p><code>type</code> (optional)</p>
<ul>
<li>&#x91CA;&#x4E49;<br>  &#x51FD;&#x6570;&#x6267;&#x884C;&#x7684;&#x7C7B;&#x578B;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;Boxplot&#x65B9;&#x6CD5;&#x3002;&#x5176;&#x4ED6;&#x53EF;&#x9009;&#x65B9;&#x6CD5;&#x89C1;<a href="#jump">5.&#x65B9;&#x6CD5;</a></li>
<li>&#x7C7B;&#x578B;<br>  &#x5B57;&#x7B26;&#x578B;(str)</li>
</ul>
<p><code>times</code> (optional)</p>
<ul>
<li>&#x91CA;&#x4E49;<br>  &#x53BB;&#x6781;&#x503C;&#x6D41;&#x7A0B;&#x7684;&#x5FAA;&#x73AF;&#x6B21;&#x6570;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;1&#x3002;&#x8BE5;&#x53C2;&#x6570;&#x5728;<code>type=&apos;FixRate&apos;</code>&#x65F6;&#x65E0;&#x6548;<br>  &#x53EF;&#x9009;&#x62E9;&#x8FDB;&#x884C;&#x591A;&#x6B21;&#x91CD;&#x590D;&#x53BB;&#x6781;&#x503C;&#x6765;&#x5C06;&#x5F02;&#x5E38;&#x503C;&#x5254;&#x9664;&#x3002;</li>
<li>&#x7C7B;&#x578B;<br>  &#x6574;&#x578B;(int)</li>
</ul>
<p><code>threshold</code> (optional)</p>
<ul>
<li>&#x91CA;&#x4E49;<br>  &#x53BB;&#x6781;&#x503C;&#x6D41;&#x7A0B;&#x7684;&#x5FAA;&#x73AF;&#x6B21;&#x6570;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;1&#x3002;&#x8BE5;&#x53C2;&#x6570;&#x4EC5;&#x5728;<code>type=&apos;FixRate&apos;</code>&#x65F6;&#x6709;&#x6548;</li>
<li>&#x7C7B;&#x578B;<br>  &#x6D6E;&#x70B9;&#x578B;(float)</li>
</ul>
<p><code>scope</code> (optional)</p>
<ul>
<li>&#x91CA;&#x4E49;<br>  &#x53BB;&#x6781;&#x503C;&#x7684;&#x5408;&#x7406;&#x503C;&#x8303;&#x56F4;&#xFF0C;&#x9ED8;&#x8BA4;&#x4E3A;3&#x3002;&#x8BE5;&#x53C2;&#x6570;&#x4EC5;&#x5728;<code>type=&apos;MeanStd&apos;</code>&#x548C;<code>type=&apos;MAD&apos;</code>&#x65F6;&#x6709;&#x6548;</li>
<li>&#x7C7B;&#x578B;<br>  &#x6574;&#x578B;(int)</li>
</ul>
</li>
<li><p>&#x8FD4;&#x56DE;</p>
<ul>
<li>&#x91CA;&#x4E49;<br>  &#x56E0;&#x5B50;&#x503C;&#x7ECF;&#x8FC7;&#x53BB;&#x6781;&#x503C;&#x540E;&#x7684;&#x6570;&#x636E;</li>
<li>&#x7C7B;&#x578B;<br>  &#x6570;&#x636E;&#x6846;(pd.DataFrame)<br>  index&#x4E3A;&#x8BC1;&#x5238;&#x4EE3;&#x7801;&#xFF0C;&#x7C7B;&#x578B;&#x4E3A;&#x5B57;&#x7B26;&#x578B;(str)&#xFF1B;columns&#x4E3A;&#x4EA4;&#x6613;&#x6708;&#x4EFD;/&#x65E5;&#x671F;&#xFF0C;&#x7C7B;&#x578B;&#x4E3A;&#x5B57;&#x7B26;&#x578B;(str)&#x3002;</li>
</ul>
</li>
<li><p>&#x4F8B;&#x5B50;</p>
<ul>
<li><p>&#x8F93;&#x5165;</p>
<pre><code class="lang-python"><span class="hljs-keyword">import</span> pandas <span class="hljs-keyword">as</span> pd
<span class="hljs-keyword">import</span> sys
sys.path.append(<span class="hljs-string">&apos;modules&apos;</span>)
<span class="hljs-keyword">from</span> factorProcess <span class="hljs-keyword">import</span> *

factor = pd.read_csv(<span class="hljs-string">&apos;factor/IVCAPM.csv&apos;</span>).set_index(<span class="hljs-string">&apos;secIDs&apos;</span>)

afterWinsorize = winsorize(factor, type=<span class="hljs-string">&apos;Boxplot&apos;</span>, times=<span class="hljs-number">1</span>)
print(afterWinsorize)
</code></pre>
</li>
<li><p>&#x8F93;&#x51FA;</p>
<pre><code class="lang-python">           <span class="hljs-number">200501</span>    <span class="hljs-number">200502</span>    <span class="hljs-number">200503</span>    <span class="hljs-number">200504</span>    <span class="hljs-number">200505</span>    <span class="hljs-number">200506</span>  ...    <span class="hljs-number">202012</span>    <span class="hljs-number">202101</span>    <span class="hljs-number">202102</span>    <span class="hljs-number">202103</span>    <span class="hljs-number">202104</span>    <span class="hljs-number">202105</span>
<span class="hljs-number">000001.</span>SZ  <span class="hljs-number">0.015290</span>  <span class="hljs-number">0.013364</span>  <span class="hljs-number">0.014068</span>  <span class="hljs-number">0.035986</span>  <span class="hljs-number">0.016192</span>  <span class="hljs-number">0.014777</span>  ...  <span class="hljs-number">0.016279</span>  <span class="hljs-number">0.031073</span>  <span class="hljs-number">0.036874</span>  <span class="hljs-number">0.020496</span>  <span class="hljs-number">0.018372</span>  <span class="hljs-number">0.014958</span>
<span class="hljs-number">000002.</span>SZ  <span class="hljs-number">0.011210</span>  <span class="hljs-number">0.012573</span>  <span class="hljs-number">0.016413</span>  <span class="hljs-number">0.015861</span>  <span class="hljs-number">0.020428</span>  <span class="hljs-number">0.016811</span>  ...  <span class="hljs-number">0.010766</span>  <span class="hljs-number">0.020358</span>  <span class="hljs-number">0.028710</span>  <span class="hljs-number">0.016972</span>  <span class="hljs-number">0.011943</span>  <span class="hljs-number">0.011025</span>
<span class="hljs-number">000004.</span>SZ  <span class="hljs-number">0.016449</span>  <span class="hljs-number">0.010543</span>  <span class="hljs-number">0.018426</span>  <span class="hljs-number">0.030790</span>  <span class="hljs-number">0.030028</span>  <span class="hljs-number">0.023188</span>  ...  <span class="hljs-number">0.030267</span>  <span class="hljs-number">0.034673</span>  <span class="hljs-number">0.034433</span>  <span class="hljs-number">0.015382</span>  <span class="hljs-number">0.032928</span>  <span class="hljs-number">0.018311</span>
<span class="hljs-number">000005.</span>SZ       NaN       NaN       NaN       NaN       NaN       NaN  ...  <span class="hljs-number">0.006703</span>  <span class="hljs-number">0.017834</span>  <span class="hljs-number">0.037272</span>  <span class="hljs-number">0.042572</span>       NaN       NaN
<span class="hljs-number">000006.</span>SZ  <span class="hljs-number">0.037530</span>  <span class="hljs-number">0.017942</span>  <span class="hljs-number">0.020076</span>  <span class="hljs-number">0.016375</span>  <span class="hljs-number">0.019311</span>  <span class="hljs-number">0.010573</span>  ...  <span class="hljs-number">0.020690</span>  <span class="hljs-number">0.018514</span>  <span class="hljs-number">0.020956</span>  <span class="hljs-number">0.016187</span>  <span class="hljs-number">0.011790</span>  <span class="hljs-number">0.009745</span>
<span class="hljs-prompt">... </span>            ...       ...       ...       ...       ...       ...  ...       ...       ...       ...       ...       ...       ...
<span class="hljs-number">688699.</span>SH       NaN       NaN       NaN       NaN       NaN       NaN  ...       NaN       NaN       NaN  <span class="hljs-number">0.032083</span>  <span class="hljs-number">0.071143</span>  <span class="hljs-number">0.038365</span>
<span class="hljs-number">688777.</span>SH       NaN       NaN       NaN       NaN       NaN       NaN  ...       NaN       NaN  <span class="hljs-number">0.023993</span>  <span class="hljs-number">0.026600</span>  <span class="hljs-number">0.024762</span>  <span class="hljs-number">0.038939</span>
<span class="hljs-number">688788.</span>SH       NaN       NaN       NaN       NaN       NaN       NaN  ...       NaN  <span class="hljs-number">0.039014</span>  <span class="hljs-number">0.032679</span>  <span class="hljs-number">0.019213</span>  <span class="hljs-number">0.020473</span>  <span class="hljs-number">0.024783</span>
<span class="hljs-number">688819.</span>SH       NaN       NaN       NaN       NaN       NaN       NaN  ...       NaN       NaN       NaN       NaN  <span class="hljs-number">0.015526</span>  <span class="hljs-number">0.017392</span>
<span class="hljs-number">688981.</span>SH       NaN       NaN       NaN       NaN       NaN       NaN  ...  <span class="hljs-number">0.027191</span>  <span class="hljs-number">0.024486</span>  <span class="hljs-number">0.026898</span>  <span class="hljs-number">0.016962</span>  <span class="hljs-number">0.016138</span>  <span class="hljs-number">0.013585</span>

[<span class="hljs-number">4287</span> rows x <span class="hljs-number">197</span> columns]
</code></pre>
</li>
</ul>
</li>
<li><p><span id="jump">&#x65B9;&#x6CD5;</span></p>
</li>
</ol>
<p>&#x76EE;&#x524D;&#x652F;&#x6301;&#x7684;&#x53BB;&#x6781;&#x503C;&#x65B9;&#x6CD5;&#x5982;&#x4E0B;:&#xFF08;&#x6CE8;&#x610F;&#x5927;&#x5C0F;&#x5199;&#xFF09;  </p>
<table>
<thead>
<tr>
<th style="text-align:left">&#x4EE3;&#x7801;</th>
<th style="text-align:left">&#x65B9;&#x6CD5;</th>
<th style="text-align:left">&#x542B;&#x4E49;</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">FixRate</td>
<td style="text-align:left">&#x56FA;&#x5B9A;&#x6BD4;&#x4F8B;&#x6CD5;</td>
<td style="text-align:left">&#x5BF9;&#x5934;&#x5C3E;&#x56FA;&#x5B9A;&#x6BD4;&#x4F8B;&#x7684;&#x6781;&#x7AEF;&#x503C;&#x8FDB;&#x884C;&#x53BB;&#x9664;&#xFF0C;&#x5373;&#x76F4;&#x63A5;&#x7F29;&#x5C3E;</td>
</tr>
<tr>
<td style="text-align:left">MeanStd</td>
<td style="text-align:left">&#x5747;&#x503C;&#x65B9;&#x5DEE;&#x6CD5;</td>
<td style="text-align:left">&#x5047;&#x5B9A;&#x56E0;&#x5B50;&#x670D;&#x4ECE;&#x6B63;&#x6001;&#x5206;&#x5E03;&#xFF0C;&#x5C06;&#x504F;&#x79BB;&#x5747;&#x503C;n&#x500D;&#x6807;&#x51C6;&#x5DEE;&#x7684;&#x503C;&#x89C6;&#x4E3A;&#x5F02;&#x5E38;&#x503C;</td>
</tr>
<tr>
<td style="text-align:left">MAD</td>
<td style="text-align:left">&#x4E2D;&#x503C;&#x7EDD;&#x5BF9;&#x504F;&#x5DEE;&#x6CD5;</td>
<td style="text-align:left">&#x5C06;&#x504F;&#x79BB;&#x4E2D;&#x503C;n&#x500D;&#x7EDD;&#x5BF9;&#x504F;&#x5DEE;&#x7684;&#x503C;&#x89C6;&#x4E3A;&#x5F02;&#x5E38;&#x503C;</td>
</tr>
<tr>
<td style="text-align:left">Boxplot</td>
<td style="text-align:left">Boxplot&#x6CD5;</td>
<td style="text-align:left">&#x4F7F;&#x7528;&#x504F;&#x5EA6;&#x8C03;&#x6574;&#x7684;Boxplot&#x65B9;&#x6CD5;&#x5B9A;&#x4E49;&#x4E0A;&#x4E0B;&#x9650;&#xFF0C;&#x5E76;&#x5C06;&#x5176;&#x5916;&#x7684;&#x6570;&#x636E;&#x89C6;&#x4E3A;&#x5F02;&#x5E38;&#x503C;</td>
</tr>
</tbody>
</table>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../factorProcess/describe.html" class="navigation navigation-prev " aria-label="Previous page: describe()"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../factorProcess/neutralize.html" class="navigation navigation-next " aria-label="Next page: neutralize()"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../gitbook/app.js"></script>

    
    <script src="../gitbook/plugins/gitbook-plugin-back-to-top-button/plugin.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-splitter/splitter.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-code/plugin.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-auto-scroll-table/plugin.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"back-to-top-button":{},"chapter-fold":{},"expandable-chapters":{},"splitter":{},"popup":{},"code":{"copyButtons":true},"auto-scroll-table":{},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":[]},"fontsettings":{"theme":"white","family":"sans","size":2}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
